//
//  LCNetWork.h
//  LCPackage
//
//  Created by 马军凯 on 2021/6/22.
//  Copyright © 2021 龙采科技集团. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

#define requstTimeOut  60   //接口请求超时时间
#define uploadTimeOut  300  //上传图片的超时时间

//成功的block
typedef void (^RequestSuccessBlock)(NSDictionary *parma,NSDictionary *dic, NSString *url, NSString *Json);
//失败的block
typedef void (^RequestFailBlock)(NSError *error, NSString *url);

@interface LCNetWork : NSObject <NSURLSessionTaskDelegate>

//block
@property (nonatomic, copy) RequestSuccessBlock block_success;
@property (nonatomic, copy) RequestFailBlock block_fail;

@property (nonatomic, strong) NSURLSession *manager;

//get请求
+ (LCNetWork *)LCRequest_Get:(NSString *)header HUD:(BOOL)HUD parameters:(NSDictionary * _Nullable)parameters success:(RequestSuccessBlock)success fail:(RequestFailBlock)fail;
//post请求
+ (LCNetWork *)LCRequest_Post:(NSString *)header HUD:(BOOL)HUD parameters:(NSDictionary * _Nullable)parameters success:(RequestSuccessBlock)success fail:(RequestFailBlock)fail;
//上传图片
+ (LCNetWork *)LCHttpFileUpload:(NSString *)headUrl HUD:(BOOL)HUD parameters:(NSDictionary * _Nullable)parameters imageArr:(NSArray *)imageArr scale:(CGFloat)scale nameArr:(NSArray*)nameArr fileNameArr:(NSArray *)fileNameArr mimeType:(NSString *)mimeType success:(RequestSuccessBlock)success fail:(RequestFailBlock)fail;

@end

NS_ASSUME_NONNULL_END
